home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KDChartParams.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  79.0 KB  |  2,788 lines

  1. /* -*- Mode: C++ -*-
  2.    KDChart - a multi-platform charting engine
  3. */
  4.  
  5. /****************************************************************************
  6.  ** Copyright (C) 2001-2003 Klar├ñlvdalens Datakonsult AB.  All rights reserved.
  7.  **
  8.  ** This file is part of the KDChart library.
  9.  **
  10.  ** This file may be distributed and/or modified under the terms of the
  11.  ** GNU General Public License version 2 as published by the Free Software
  12.  ** Foundation and appearing in the file LICENSE.GPL included in the
  13.  ** packaging of this file.
  14.  **
  15.  ** Licensees holding valid commercial KDChart licenses may use this file in
  16.  ** accordance with the KDChart Commercial License Agreement provided with
  17.  ** the Software.
  18.  **
  19.  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20.  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21.  **
  22.  ** See http://www.klaralvdalens-datakonsult.se/?page=products for
  23.  **   information about KDChart Commercial License Agreements.
  24.  **
  25.  ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
  26.  ** licensing are not clear to you.
  27.  **
  28.  **********************************************************************/
  29. #ifndef __KDCHARTPARAMS_H__
  30. #define __KDCHARTPARAMS_H__
  31.  
  32. #include <qapplication.h>
  33. #include <qfont.h>
  34. #include <qcolor.h>
  35. #include <qpen.h>
  36. #include <qmap.h>
  37. #include <qdict.h>
  38. #include <qintdict.h>
  39. #include <qobject.h>
  40. #include <qtextstream.h>
  41. #include <qsimplerichtext.h>
  42. #include <qdom.h>
  43. #include <limits.h>
  44.  
  45. #include <math.h>
  46. #ifdef Q_WS_WIN
  47. #define M_PI 3.14159265358979323846
  48. #endif
  49.  
  50. #include "KDChartGlobal.h"
  51. #include "KDChartEnums.h"
  52. #include "KDChartCustomBox.h"
  53. #include "KDFrame.h"
  54. #include "KDChartAxisParams.h"
  55. #include "KDChartPropertySet.h"
  56.  
  57. #if COMPAT_QT_VERSION >= 0x030000
  58. #include <qvaluevector.h>
  59. #else
  60. #include <qarray.h>
  61. #endif
  62.  
  63. /** \file KDChartParams.h
  64.     \brief Header for all common chart parameters.
  65.  
  66.     This file is used to access all chart parameters except of the
  67.     axis settings which you will find in \c KDChartAxisParams.h
  68.  
  69.     \see KDChartAxisParams.h
  70. */
  71.  
  72.  
  73. typedef QIntDict<KDChartPropertySet> KDChartPropertySetList;
  74.  
  75. #define KDCHART_ALL_AXES UINT_MAX-1
  76.  
  77. // PENDING(blackie) KHZ, please clean up here. I guess this defined can be removed now.
  78. // Note: The following specification matches the UINT_MAX value used
  79. //       in KDChartAxisParams::KDChartAxisParams() to initialize the
  80. //       axis' _axisIsoRefAxis member.
  81. //       OK, this is a dirty hack but is avoids circular dependency
  82. //       between KDChartParams and KDChartAxisParams
  83. #define KDCHART_NO_AXIS UINT_MAX
  84. #define KDCHART_ALL_DATASETS UINT_MAX - 1
  85.  
  86. #define KDCHART_NO_DATASET UINT_MAX
  87. #define KDCHART_UNKNOWN_CHART UINT_MAX - 2
  88. #define KDCHART_ALL_CHARTS UINT_MAX - 1
  89. #define KDCHART_NO_CHART UINT_MAX
  90. #define KDCHART_GLOBAL_LINE_STYLE UINT_MAX
  91. #define KDCHART_AUTO_SIZE INT_MAX
  92. #define KDCHART_DATA_VALUE_AUTO_DIGITS INT_MAX
  93. #define KDCHART_SAGITTAL_ROTATION INT_MAX
  94. #define KDCHART_TANGENTIAL_ROTATION INT_MAX - 1
  95. #define KDCHART_PROPSET_NORMAL_DATA 0
  96. #define KDCHART_PROPSET_TRANSPARENT_DATA 1
  97. #define KDCHART_PROPSET_HORI_LINE  2
  98. #define KDCHART_PROPSET_VERT_LINE  3
  99.  
  100. // #define KDCHART_DATA_VALUE_AUTO_COLOR KDChartAutoColor::instance()->color()
  101.  
  102. // PENDING(blackie) Can we delete this now?
  103. /* we must keep this wrongly spelled value for backward compatibility reasons */
  104. #define KDCHART_SAGGITAL_ROTATION INT_MAX
  105.  
  106. /**
  107.   Our charts may have up to 4 ordinate axes:
  108.   2 left ones and 2 right ones
  109.   */
  110. #define KDCHART_CNT_ORDINATES 4
  111.  
  112. #define KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS 8
  113. #define KDCHART_MAX_AXES 12
  114.  
  115.  
  116. #define KDCHART_DATA_VALUE_AUTO_COLOR (KDChartAutoColor::instance()->color())
  117.  
  118. class KDCHART_EXPORT KDChartAutoColor {
  119. public:
  120.     static const KDChartAutoColor* instance();
  121.     static void freeInstance();
  122.     const QColor* color() const
  123.     {
  124.         return &mColor;
  125.     }
  126. private:
  127.     KDChartAutoColor();
  128.     KDChartAutoColor( KDChartAutoColor const& );
  129.     ~KDChartAutoColor();
  130.     QColor mColor;
  131.     static KDChartAutoColor *mInstance;
  132. };
  133.  
  134. /*
  135. // #define KDCHART_DATA_VALUE_AUTO_COLOR KDChartParams_KDChartAutoColor
  136. */
  137.  
  138.  
  139. class KDCHART_EXPORT KDChartParams : public QObject
  140. {
  141.  
  142.     Q_OBJECT
  143.     Q_ENUMS(ChartType)
  144.     Q_ENUMS(SourceMode)
  145.     Q_ENUMS(BarChartSubType)
  146.     Q_ENUMS(LineChartSubType)
  147.     Q_ENUMS(LineMarkerStyle)
  148.     Q_ENUMS(AreaChartSubType)
  149.     Q_ENUMS(AreaLocation)
  150.     Q_ENUMS(PolarChartSubType)
  151.     Q_ENUMS(PolarMarkerStyle)
  152.     Q_ENUMS(HiLoChartSubType)
  153.     Q_ENUMS(BWChartSubType)
  154.     Q_ENUMS(BWStatVal)
  155.     Q_ENUMS(LegendPosition)
  156.     Q_ENUMS(LegendSource)
  157.     Q_ENUMS(HdFtPos)
  158.  
  159.     // Needed for QSA
  160.     Q_ENUMS( BrushStyle )
  161.     Q_ENUMS( PenStyle )
  162.     Q_ENUMS( Orientation )
  163.  
  164.  
  165. public slots: // PENDING(blackie) merge public slots into one section.
  166.     void setOptimizeOutputForScreen( bool screenOutput )
  167.         {
  168.             _optimizeOutputForScreen = screenOutput;
  169.         }
  170.  
  171.  
  172.     bool optimizeOutputForScreen() const
  173.         {
  174.             return _optimizeOutputForScreen;
  175.         }
  176.  
  177.     void setGlobalLeading( int left, int top, int right, int bottom );
  178.  
  179.     void setGlobalLeadingLeft( int leading )
  180.         {
  181.             _globalLeadingLeft = leading;
  182.             emit changed();
  183.         }
  184.     void setGlobalLeadingTop( int leading )
  185.         {
  186.             _globalLeadingTop = leading;
  187.             emit changed();
  188.         }
  189.     void setGlobalLeadingRight( int leading )
  190.         {
  191.             _globalLeadingRight = leading;
  192.             emit changed();
  193.         }
  194.     void setGlobalLeadingBottom( int leading )
  195.         {
  196.             _globalLeadingBottom = leading;
  197.             emit changed();
  198.         }
  199.     int globalLeadingLeft() const
  200.         {
  201.             return _globalLeadingLeft;
  202.         }
  203.     int globalLeadingTop() const
  204.         {
  205.             return _globalLeadingTop;
  206.         }
  207.     int globalLeadingRight() const
  208.         {
  209.             return _globalLeadingRight;
  210.         }
  211.     int globalLeadingBottom() const
  212.         {
  213.             return _globalLeadingBottom;
  214.         }
  215.  
  216.     int registerProperties( KDChartPropertySet& rSet );
  217.     void setProperties( int id, KDChartPropertySet& rSet );
  218.     bool removeProperties( int id );
  219.     bool properties( int id, KDChartPropertySet& rSet ) const;
  220.     KDChartPropertySet* properties( int id );
  221.     bool calculateProperties( int startId, KDChartPropertySet& rSet ) const;
  222.  
  223. public:
  224.  
  225. // MOC_SKIP_BEGIN
  226.     class KDCHART_EXPORT KDChartFrameSettings
  227.     {
  228.         // Q_OBJECT
  229.     public:
  230.         KDChartFrameSettings();
  231.         KDChartFrameSettings( uint           dataRow,
  232.                               uint           dataCol,
  233.                               uint           data3rd,
  234.                               const KDFrame& frame,
  235.                               int            outerGapX,
  236.                               int            outerGapY,
  237.                               int            innerGapX,
  238.                               int            innerGapY,
  239.                               bool           addFrameWidthToLayout  = true,
  240.                               bool           addFrameHeightToLayout = true );
  241.  
  242.         // public slots:
  243.         uint dataRow() const
  244.             {
  245.                 return _dataRow;
  246.             }
  247.         uint dataCol() const
  248.             {
  249.                 return _dataCol;
  250.             }
  251.         uint data3rd() const
  252.             {
  253.                 return _data3rd;
  254.             }
  255.  
  256.         void setDataRow( uint dataRow )
  257.             {
  258.                 _dataRow = dataRow;
  259.             }
  260.         void setDataCol( uint dataCol )
  261.             {
  262.                 _dataCol = dataCol;
  263.             }
  264.         void setData3rd( uint data3rd )
  265.             {
  266.                 _data3rd = data3rd;
  267.             }
  268.  
  269.  
  270.         void resetFrame()
  271.         {
  272.             if( _frame )
  273.                 delete _frame;
  274.             _frame = new KDFrame();
  275.         }
  276.  
  277.  
  278.         const KDFrame* framePtr() const
  279.             {
  280.                 return _frame;
  281.             }
  282.  
  283.  
  284.         const KDFrame& frame() const
  285.             {
  286.                 return *_frame;
  287.             }
  288.  
  289.  
  290.         int innerGapX() const
  291.             {
  292.                 return _innerGapX;
  293.             }
  294.  
  295.  
  296.         int innerGapY() const
  297.             {
  298.                 return _innerGapY;
  299.             }
  300.  
  301.  
  302.         int outerGapX() const
  303.             {
  304.                 return _outerGapX;
  305.             }
  306.  
  307.  
  308.         int outerGapY() const
  309.             {
  310.                 return _outerGapY;
  311.             }
  312.  
  313.  
  314.         bool addFrameWidthToLayout() const
  315.             {
  316.                 return _addFrameWidthToLayout;
  317.             }
  318.  
  319.  
  320.         bool addFrameHeightToLayout() const
  321.             {
  322.                 return _addFrameHeightToLayout;
  323.             }
  324.  
  325.         // public:
  326.         virtual ~KDChartFrameSettings();
  327.  
  328.  
  329.         static void createFrameSettingsNode( QDomDocument& document,
  330.                                              QDomNode& parent,
  331.                                              const QString& elementName,
  332.                                              const KDChartFrameSettings* settings,
  333.                                              uint areaId );
  334.  
  335.         static bool readFrameSettingsNode( const QDomElement& element,
  336.                                            KDChartFrameSettings& settings,
  337.                                            uint& areaId );
  338.  
  339.  
  340.         static void deepCopy( KDChartFrameSettings& D, const KDChartFrameSettings& R ) {
  341.             D._dataRow = R._dataRow;
  342.             D._dataCol = R._dataCol;
  343.             D._data3rd = R._data3rd;
  344.  
  345.             delete D._frame;
  346.             if( R._frame ){
  347.                 D._frame = new KDFrame();
  348.                 KDFrame::deepCopy(*D._frame, *R._frame);
  349.             }else{
  350.                 D._frame = 0;
  351.             }
  352.  
  353.             D._outerGapX = R._outerGapX;
  354.             D._outerGapY = R._outerGapY;
  355.             D._innerGapX = R._innerGapX;
  356.             D._innerGapY = R._innerGapY;
  357.             D._addFrameWidthToLayout = R._addFrameWidthToLayout;
  358.             D._addFrameHeightToLayout = R._addFrameHeightToLayout;
  359.         }
  360.  
  361.     private:
  362.         // KDChartFrameSettings( const KDChartFrameSettings& other ) :QObject( 0 ) {
  363.         KDChartFrameSettings( const KDChartFrameSettings& ) {}
  364.         KDChartFrameSettings& operator=( const KDChartFrameSettings& ){return *this;}
  365.  
  366.  
  367.     private:
  368.         uint    _dataRow;
  369.         uint    _dataCol;
  370.         uint    _data3rd;
  371.         KDFrame* _frame;
  372.         int     _outerGapX;
  373.         int     _outerGapY;
  374.         int     _innerGapX;
  375.         int     _innerGapY;
  376.         bool    _addFrameWidthToLayout;
  377.         bool    _addFrameHeightToLayout;
  378.     };
  379.  
  380. // MOC_SKIP_END
  381.  
  382. public slots:
  383.  
  384.     void setFrame( uint           area,
  385.                    const KDFrame& frame,
  386.                    int            outerGapX,
  387.                    int            outerGapY,
  388.                    int            innerGapX,
  389.                    int            innerGapY,
  390.                    bool           addFrameWidthToLayout = true,
  391.                    bool           addFrameHeightToLayout = true )
  392.         {
  393.             _areaDict.setAutoDelete( TRUE );
  394.             _areaDict.replace( QString( "%1/-----/-----/-----" ).arg( area, 5 ),
  395.                               new KDChartFrameSettings(0,0,0,
  396.                                                        frame,
  397.                                                        outerGapX,
  398.                                                        outerGapY,
  399.                                                        innerGapX,
  400.                                                        innerGapY,
  401.                                                        addFrameWidthToLayout,
  402.                                                        addFrameHeightToLayout ) );
  403.             emit changed();
  404.         }
  405.  
  406.  
  407.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  408.     void setSimpleFrame( uint        area,
  409.                          int         outerGapX = 0,
  410.                          int         outerGapY = 0,
  411.                          int         innerGapX = 0,
  412.                          int         innerGapY = 0,
  413.                          bool        addFrameWidthToLayout      = true,
  414.                          bool        addFrameHeightToLayout     = true,
  415.                          KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
  416.                          int                     lineWidth      = 1,
  417.                          int                     midLineWidth   = 0,
  418.                          QPen                    pen            = QPen(),
  419.                          QBrush                  background     = QBrush( Qt::NoBrush ),
  420.                          const QPixmap*          backPixmap     = 0, // no pixmap
  421.                          KDFrame::BackPixmapMode backPixmapMode = KDFrame::PixStretched,
  422.                          int                     shadowWidth    = 0,
  423.                          KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
  424.         {
  425.             _areaDict.setAutoDelete( TRUE );
  426.             KDFrame frame( QRect(0,0,0,0),
  427.                      simpleFrame,
  428.                      lineWidth,
  429.                      midLineWidth,
  430.                      pen,
  431.                      background,
  432.                      backPixmap,
  433.                      backPixmapMode,
  434.                      shadowWidth,
  435.                            sunPos );
  436.  
  437.             _areaDict.replace( QString( "%1/-----/-----/-----" ).arg( area, 5 ),
  438.                               new KDChartFrameSettings( 0,0,0, frame,
  439.                                                         outerGapX,
  440.                                                         outerGapY,
  441.                                                         innerGapX,
  442.                                                         innerGapY,
  443.                                                         addFrameWidthToLayout,
  444.                                                         addFrameHeightToLayout ) );
  445.             emit changed();
  446.         }
  447.  
  448.     bool removeFrame( uint area );
  449.  
  450.  
  451.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  452.     void setDataRegionFrame( uint dataRow,
  453.                              uint dataCol,
  454.                              uint, // important: we ignore the data3rd parameter for now!
  455.                              int  innerGapX = 0,
  456.                              int  innerGapY = 0,
  457.                              bool addFrameWidthToLayout      = true,
  458.                              bool addFrameHeightToLayout     = true,
  459.                              KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
  460.                              int                     lineWidth      = 1,
  461.                              int                     midLineWidth   = 0,
  462.                              QPen                    pen            = QPen(),
  463.                              int                     shadowWidth    = 0,
  464.                              KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
  465.         {
  466.             _areaDict.setAutoDelete( TRUE );
  467.             KDFrame frame( QRect(0,0,0,0),
  468.                            simpleFrame,
  469.                            lineWidth,
  470.                            midLineWidth,
  471.                            pen,
  472.                            QBrush( Qt::NoBrush ),
  473.                            0,
  474.                            KDFrame::PixStretched,
  475.                            shadowWidth,
  476.                            sunPos );
  477.  
  478.             _areaDict.replace(
  479.                 dataRegionFrameAreaName( dataRow, dataCol, 0 ), //data3rd 5 ),
  480.                 new KDChartFrameSettings( dataRow,
  481.                                           dataCol,
  482.                                           0, // important: we ignore the data3rd parameter for now!
  483.                                           frame,
  484.                                           0,
  485.                                           0,
  486.                                           innerGapX,
  487.                                           innerGapY,
  488.                                           addFrameWidthToLayout,
  489.                                           addFrameHeightToLayout ) );
  490.             emit changed();
  491.         }
  492.  
  493.  
  494.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  495.     bool moveDataRegionFrame( uint oldDataRow,
  496.                              uint oldDataCol,
  497.                              uint, // important: we ignore the data3rd parameter for now!
  498.                              uint newDataRow,
  499.                              uint newDataCol,
  500.                              uint // important: we ignore the data3rd parameter for now!
  501.                              );
  502.  
  503.  
  504.     const KDChartFrameSettings* frameSettings( uint area,
  505.                                                bool& bFound,
  506.                                                int* pIterIdx=0 ) const;
  507.  
  508.     const KDChartFrameSettings* nextFrameSettings( bool& bFound,
  509.                                                    int* pIterIdx ) const;
  510.  
  511.  
  512. public:
  513.     typedef QIntDict <KDChartCustomBox > CustomBoxDict;
  514.  
  515. public slots:
  516.     uint insertCustomBox( const KDChartCustomBox & box );
  517.     bool removeCustomBox( const uint & idx );
  518.  
  519.     void removeAllCustomBoxes()
  520.     {
  521.         emit changed();
  522.         _customBoxDict.setAutoDelete( true );
  523.         _customBoxDict.clear();
  524.     }
  525.  
  526.     KDChartCustomBox* customBoxRef( uint box );
  527.     const KDChartCustomBox* customBox( uint box ) const;
  528.     uint maxCustomBoxIdx() const;
  529.  
  530.  
  531. public:
  532.     enum ChartType { NoType, Bar, Line, Area, Pie, HiLo, Ring, Polar, BoxWhisker };
  533.  
  534. public slots:
  535.     void setChartType( ChartType chartType );
  536.     ChartType chartType() const
  537.         {
  538.             return _chartType;
  539.         }
  540.  
  541.  
  542.     static QString chartTypeToString( ChartType type );
  543.     static ChartType stringToChartType( const QString& string );
  544.  
  545.     void setAdditionalChartType( ChartType chartType );
  546.     ChartType additionalChartType() const
  547.         {
  548.             return _additionalChartType;
  549.         }
  550. public:
  551.  
  552.     enum SourceMode {
  553.         UnknownMode      = 0,
  554.         DontUse          = 1,
  555.         DataEntry        = 2,
  556.         AxisLabel        = 3,
  557.         LegendText       = 4,
  558.         ExtraLinesAnchor = 5,
  559.         Last_SourceMode  = ExtraLinesAnchor };
  560.  
  561. public slots:
  562.     void setChartSourceMode( SourceMode mode,
  563.                              uint dataset,
  564.                              uint dataset2 = KDCHART_NO_DATASET,
  565.                              uint chart = 0 );
  566.  
  567.     static QString chartSourceModeToString( const SourceMode& mode );
  568.     static SourceMode stringToChartSourceMode( const QString& string );
  569.  
  570.  
  571.     bool neverUsedSetChartSourceMode() const
  572.         {
  573.             return !_setChartSourceModeWasUsed;
  574.         }
  575.  
  576.     SourceMode chartSourceMode( uint dataset,
  577.                                 uint dataset2 = KDCHART_NO_DATASET,
  578.                                 uint* chart = 0 ) const;
  579.  
  580.     bool findDataset( SourceMode mode,
  581.                       uint& dataset,
  582.                       uint& dataset2,
  583.                       uint chart = 0 ) const;
  584.  
  585.     bool findDatasets( SourceMode mode1,
  586.                        SourceMode mode2,
  587.                        uint& dataset,
  588.                        uint& dataset2,
  589.                        uint chart = 0 ) const;
  590.  
  591.     uint maxDatasetSourceMode() const
  592.         {
  593.             return _maxDatasetSourceMode;
  594.         }
  595.  
  596.  
  597.     void setDefaultAxesTypes();
  598.     void activateDefaultAxes();
  599.  
  600.  
  601.     void setNumValues( uint numValues )
  602.         {
  603.             _numValues = numValues;
  604.             emit changed();
  605.         }
  606.  
  607.  
  608.     int numValues() const
  609.         {
  610.             return _numValues;
  611.         }
  612.  
  613.  
  614.     void calculateShadowColors( QColor color,
  615.                                 QColor& shadow1,
  616.                                 QColor& shadow2 ) const;
  617.  
  618.     void setDataColor( uint dataset, QColor color );
  619.     QColor dataColor( uint dataset ) const;
  620.  
  621.     void setDataDefaultColors();
  622.     void setDataRainbowColors();
  623.     void setDataSubduedColors( bool ordered = false );
  624.  
  625.  
  626.     void setShadowBrightnessFactor( double factor )
  627.         {
  628.             _shadowBrightnessFactor = factor;
  629.             recomputeShadowColors();
  630.             emit changed();
  631.         }
  632.  
  633.     double shadowBrightnessFactor() const
  634.         {
  635.             return _shadowBrightnessFactor;
  636.         }
  637.  
  638.  
  639.     void setShadowPattern( BrushStyle style ) {
  640.         _shadowPattern = style;
  641.         emit changed();
  642.     }
  643.  
  644.     Qt::BrushStyle shadowPattern() const {
  645.         return _shadowPattern;
  646.     }
  647.  
  648.  
  649.     void setOutlineDataColor( QColor color )
  650.         {
  651.             _outlineDataColor = color;
  652.             emit changed();
  653.         }
  654.  
  655.  
  656.     QColor outlineDataColor() const
  657.         {
  658.             return _outlineDataColor;
  659.         }
  660.  
  661.  
  662.     void setOutlineDataLineWidth( uint width )
  663.         {
  664.             _outlineDataLineWidth = width;
  665.             emit changed();
  666.         }
  667.  
  668.     uint outlineDataLineWidth() const
  669.         {
  670.             return _outlineDataLineWidth;
  671.         }
  672.  
  673.  
  674.     void setOutlineDataLineStyle( PenStyle style )
  675.         {
  676.             _outlineDataLineStyle = style;
  677.             emit changed();
  678.         }
  679.  
  680.     PenStyle outlineDataLineStyle() const
  681.         {
  682.             return _outlineDataLineStyle;
  683.         }
  684.  
  685.  
  686.     uint maxDataColor() const
  687.         {
  688.             return _maxDatasetColor;
  689.         }
  690.  
  691.  
  692.     void setThreeDShadowColors( bool shadow )
  693.         {
  694.             _threeDShadowColors = shadow;
  695.             emit changed();
  696.         }
  697.  
  698.  
  699.     bool threeDShadowColors() const
  700.         {
  701.             return _threeDShadowColors;
  702.         }
  703.  
  704.  
  705.     static int roundVal( double d )
  706.         {
  707.             double fr;
  708.             double i=0.0; // initialization necessary for Borland C++
  709.             fr = modf( d, &i );
  710.             int ret = static_cast < int > ( i );
  711.             if( 0.49999 <= fabs( fr ) )
  712.                 ret += ( 0.0 < d ) ? 1 : -1;
  713.             return ret;
  714.         }
  715.  
  716.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  717.     void setPrintDataValues( bool active,
  718.                              uint chart = KDCHART_ALL_CHARTS,
  719.                              int divPow10 = 0,
  720.                              int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
  721.                              QFont* font   = 0,
  722.                              uint size     = UINT_MAX, //  <-- makes us use the *default* font params
  723.                              //                                by IGNORING settings of
  724.                              //                                the following parameters!
  725.                              const QColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
  726.                              KDChartEnums::PositionFlag negativePosition = KDChartEnums::PosCenter,
  727.                              uint negativeAlign    = Qt::AlignCenter,
  728.                              int  negativeDeltaX   =    0,
  729.                              int  negativeDeltaY   =    0,
  730.                              int  negativeRotation =    0,
  731.                              KDChartEnums::PositionFlag positivePosition = KDChartEnums::PosCenter,
  732.                              uint positiveAlign    = Qt::AlignCenter,
  733.                              int  positiveDeltaX   =    0,
  734.                              int  positiveDeltaY   =    0,
  735.                              int  positiveRotation =    0,
  736.                              KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate );
  737.  
  738.     void setDataValuesCalc( int divPow10 = 0,
  739.                             int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
  740.                             uint chart = KDCHART_ALL_CHARTS );
  741.     void setDataValuesFont( QFont* font,
  742.                             uint size  = UINT_MAX,
  743.                             uint chart = KDCHART_ALL_CHARTS );
  744.  
  745.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  746.     void setDataValuesPlacing( KDChartEnums::PositionFlag position,
  747.                                uint align,
  748.                                int  deltaX,
  749.                                int  deltaY,
  750.                                int  rotation,
  751.                                bool specifyingPositiveValues = true,
  752.                                uint chart = KDCHART_ALL_CHARTS );
  753.  
  754.     void setDataValuesColors( const QColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
  755.                               const QBrush& background = Qt::NoBrush,
  756.                               uint chart = KDCHART_ALL_CHARTS );
  757.  
  758.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  759.     void setDataValuesPolicy( KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate,
  760.                               uint chart = KDCHART_ALL_CHARTS );
  761.  
  762.     void setDataValuesShowInfinite( bool dataValuesShowInfinite = true,
  763.                                     uint chart = KDCHART_ALL_CHARTS );
  764.  
  765.     void setPrintDataValuesWithDefaultFontParams( uint chart = KDCHART_ALL_CHARTS,
  766.                                                   bool callSetPrintDataValues = true );
  767.  
  768.     void setAllowOverlappingDataValueTexts( bool allow )
  769.         {
  770.             _allowOverlappingDataValueTexts = allow;
  771.         }
  772.  
  773.  
  774.     bool allowOverlappingDataValueTexts() const
  775.         {
  776.             return _allowOverlappingDataValueTexts;
  777.         }
  778.  
  779.     bool printDataValuesWithDefaultFontParams( uint chart ) const
  780.         {
  781.             return chart ? _printDataValuesSettings2._useDefaultFontParams
  782.                 : _printDataValuesSettings._useDefaultFontParams;
  783.         }
  784.  
  785.     bool printDataValues( uint chart ) const
  786.         {
  787.             return chart ? _printDataValuesSettings2._printDataValues
  788.                 : _printDataValuesSettings._printDataValues;
  789.         }
  790.  
  791.  
  792.     int dataValuesDivPow10( uint chart ) const
  793.         {
  794.             return chart ? _printDataValuesSettings2._divPow10
  795.                 : _printDataValuesSettings._divPow10;
  796.         }
  797.  
  798.  
  799.     int dataValuesDigitsBehindComma( uint chart ) const
  800.         {
  801.             return chart ? _printDataValuesSettings2._digitsBehindComma
  802.                 : _printDataValuesSettings._digitsBehindComma;
  803.         }
  804.  
  805.  
  806.     QFont dataValuesFont( uint chart ) const
  807.         {
  808.             return chart ? _printDataValuesSettings2._dataValuesFont
  809.                 : _printDataValuesSettings._dataValuesFont;
  810.         }
  811.  
  812.  
  813.     bool dataValuesUseFontRelSize( uint chart ) const
  814.         {
  815.             return chart ? _printDataValuesSettings2._dataValuesUseFontRelSize
  816.                 : _printDataValuesSettings._dataValuesUseFontRelSize;
  817.         }
  818.  
  819.  
  820.     int dataValuesFontRelSize( uint chart ) const
  821.         {
  822.             return chart ? _printDataValuesSettings2._dataValuesFontRelSize
  823.                 : _printDataValuesSettings._dataValuesFontRelSize;
  824.         }
  825.  
  826.  
  827.     QColor dataValuesColor( uint chart ) const
  828.         {
  829.             return chart ? _printDataValuesSettings2._dataValuesColor
  830.                 : _printDataValuesSettings._dataValuesColor;
  831.         }
  832.  
  833.  
  834.     QBrush dataValuesBackground( uint chart ) const
  835.         {
  836.             return chart ? _printDataValuesSettings2._dataValuesBrush
  837.                 : _printDataValuesSettings._dataValuesBrush;
  838.         }
  839.  
  840.  
  841.     bool dataValuesAutoColor( uint chart ) const
  842.         {
  843.             return chart ? _printDataValuesSettings2._dataValuesAutoColor
  844.                 : _printDataValuesSettings._dataValuesAutoColor;
  845.         }
  846.  
  847.  
  848.     KDChartEnums::PositionFlag dataValuesAnchorPosition( uint chart,
  849.                                                          bool negative ) const;
  850.     uint dataValuesAnchorAlign( uint chart, bool negative ) const;
  851.     int dataValuesAnchorDeltaX( uint chart, bool negative ) const;
  852.     int dataValuesAnchorDeltaY( uint chart, bool negative ) const;
  853.     int dataValuesRotation( uint chart, bool negative ) const;
  854.  
  855.     KDChartEnums::TextLayoutPolicy dataValuesLayoutPolicy( uint chart ) const
  856.         {
  857.             return chart ? _printDataValuesSettings2._dataValuesLayoutPolicy
  858.                 : _printDataValuesSettings._dataValuesLayoutPolicy;
  859.         }
  860.  
  861.  
  862.     bool dataValuesShowInfinite( uint chart ) const
  863.         {
  864.             return chart ? _printDataValuesSettings2._dataValuesShowInfinite
  865.                 : _printDataValuesSettings._dataValuesShowInfinite;
  866.         }
  867.  
  868.  
  869.     // for backward compatibility we may NOT remove these functions:
  870.     void setPrintDataValuesColor( uint chart = KDCHART_ALL_CHARTS,
  871.                                   const QColor* color = KDCHART_DATA_VALUE_AUTO_COLOR );
  872.     void setPrintDataValuesFontRelSize( uint chart, uint size );
  873.  
  874.  
  875.     static QString markerStyleToString(   int style );
  876.     static QString markerStyleToStringTr( int style );
  877.     static int stringToMarkerStyle(   const QString& string );
  878.     static int stringToMarkerStyleTr( const QString& string );
  879.  
  880.     // END GENERAL
  881.  
  882.  
  883. public:
  884.  
  885.     // BAR CHART-SPECIFIC
  886.     enum BarChartSubType { BarNormal, BarStacked, BarPercent, BarMultiRows };
  887.  
  888. public slots:
  889.     void setBarChartSubType( BarChartSubType barChartSubType )
  890.         {
  891.             _barChartSubType = barChartSubType;
  892.             emit changed();
  893.         }
  894.  
  895.     BarChartSubType barChartSubType() const
  896.         {
  897.             return _barChartSubType;
  898.         }
  899.  
  900.  
  901.  
  902.  
  903.  
  904.     static QString barChartSubTypeToString( BarChartSubType type );
  905.     static BarChartSubType stringToBarChartSubType( const QString& string );
  906.  
  907.  
  908.     void setThreeDBars( bool threeDBars )
  909.         {
  910.             _threeDBars = threeDBars;
  911.             emit changed();
  912.         }
  913.  
  914.     bool threeDBars() const
  915.         {
  916.             return _threeDBars;
  917.         }
  918.  
  919.  
  920.     void setThreeDBarsShadowColors( bool shadow )
  921.         {
  922.             _threeDShadowColors = shadow;
  923.             emit changed();
  924.         }
  925.  
  926.  
  927.     bool threeDBarsShadowColors() const
  928.         {
  929.             return _threeDShadowColors;
  930.         }
  931.  
  932.  
  933.     QColor dataShadow1Color( uint dataset ) const;
  934.     QColor dataShadow2Color( uint dataset ) const;
  935.  
  936.  
  937.     void setThreeDBarAngle( uint angle );
  938.     uint threeDBarAngle() const
  939.         {
  940.             return _threeDBarAngle;
  941.         }
  942.  
  943.  
  944.     double cosThreeDBarAngle() const
  945.         {
  946.             return _cosThreeDBarAngle;
  947.         }
  948.  
  949.  
  950.     void setThreeDBarDepth( double depth )
  951.         {
  952.             _threeDBarDepth = depth;
  953.             emit changed();
  954.         }
  955.  
  956.  
  957.     double threeDBarDepth() const
  958.         {
  959.             return _threeDBarDepth;
  960.         }
  961.  
  962.  
  963.     void setDatasetGap( int gap )
  964.         {
  965.             _datasetGap = gap;
  966.             emit changed();
  967.         }
  968.  
  969.     int datasetGap() const
  970.         {
  971.             return _datasetGap;
  972.         }
  973.  
  974.  
  975.     void setDatasetGapIsRelative( bool gapIsRelative )
  976.         {
  977.             _datasetGapIsRelative = gapIsRelative;
  978.             emit changed();
  979.         }
  980.  
  981.     bool datasetGapIsRelative() const
  982.         {
  983.             return _datasetGapIsRelative;
  984.         }
  985.  
  986.  
  987.     void setValueBlockGap( int gap )
  988.         {
  989.             _valueBlockGap = gap;
  990.             emit changed();
  991.         }
  992.  
  993.     int valueBlockGap() const
  994.         {
  995.             return _valueBlockGap;
  996.         }
  997.  
  998.  
  999.     void setValueBlockGapIsRelative( bool gapIsRelative )
  1000.         {
  1001.             _valueBlockGapIsRelative = gapIsRelative;
  1002.             emit changed();
  1003.         }
  1004.  
  1005.     bool valueBlockGapIsRelative() const
  1006.         {
  1007.             return _valueBlockGapIsRelative;
  1008.         }
  1009.  
  1010.  
  1011.     void setBarWidth( int width = KDCHART_AUTO_SIZE )
  1012.         {
  1013.           if ( width == KDCHART_AUTO_SIZE ) {
  1014.         _barWidth = width;
  1015.             _userWidth = 0;
  1016.       }
  1017.           else
  1018.       _userWidth = width;
  1019.  
  1020.           emit changed();
  1021.         }
  1022.  
  1023.  
  1024.     int barWidth() const
  1025.         {
  1026.             return _barWidth;
  1027.         }
  1028.  
  1029.   int userWidth() const
  1030.         {
  1031.       return _userWidth;
  1032.         }
  1033.  
  1034.     int numBarsDisplayed() const
  1035.         {
  1036.             return _barsDisplayed;
  1037.         }
  1038.  
  1039.     int numBarsLeft() const
  1040.         {
  1041.             return _barsLeft;
  1042.         }
  1043.  
  1044.     void setDrawSolidExcessArrows( bool solidArrows ) {
  1045.         _solidExcessArrows = solidArrows;
  1046.         emit changed();
  1047.     }
  1048.  
  1049.     bool drawSolidExcessArrows() const
  1050.         {
  1051.             return _solidExcessArrows;
  1052.         }
  1053.  
  1054.     // END BAR CHART-SPECIFIC
  1055.  
  1056. public:
  1057.     // LINE/AREA CHART-SPECIFIC
  1058.     enum LineChartSubType { LineNormal, LineStacked, LinePercent };
  1059.  
  1060. public slots:
  1061.     void setLineChartSubType( LineChartSubType lineChartSubType )
  1062.         {
  1063.             _lineChartSubType = lineChartSubType;
  1064.             emit changed();
  1065.         }
  1066.  
  1067.     LineChartSubType lineChartSubType() const
  1068.         {
  1069.             return _lineChartSubType;
  1070.         }
  1071.  
  1072.  
  1073.     static LineChartSubType stringToLineChartSubType( const QString& string );
  1074.     static QString lineChartSubTypeToString( LineChartSubType type );
  1075.  
  1076.  
  1077.     void setLineMarker( bool marker )
  1078.         {
  1079.             _lineMarker = marker;
  1080.             emit changed();
  1081.         }
  1082.  
  1083.     bool lineMarker() const
  1084.         {
  1085.             return _lineMarker;
  1086.         }
  1087.  
  1088. public:
  1089.     enum LineMarkerStyle { LineMarkerCircle  = 0,
  1090.             LineMarkerSquare  = 1,
  1091.             LineMarkerDiamond = 2,
  1092.             LineMarker1Pixel  = 3,
  1093.             LineMarker4Pixels = 4,
  1094.             LineMarkerRing    = 5,
  1095.             LineMarkerCross   = 6,
  1096.             LineMarkerFastCross = 7 };
  1097.  
  1098.     // PENDING(blackie) Add a wrapper for this
  1099.     typedef QMap<uint,LineMarkerStyle> LineMarkerStyleMap;
  1100. public slots:
  1101.  
  1102.         void setLineMarkerStyle( uint dataset, LineMarkerStyle style );
  1103.     void setLineMarkerStyles( LineMarkerStyleMap map );
  1104.     LineMarkerStyle lineMarkerStyle( uint dataset ) const;
  1105.  
  1106.     static QString lineMarkerStyleToString( LineMarkerStyle style );
  1107.     static QString lineMarkerStyleToStringTr( LineMarkerStyle style );
  1108.     static LineMarkerStyle stringToLineMarkerStyle( const QString& string );
  1109.     static LineMarkerStyle stringToLineMarkerStyleTr( const QString& string );
  1110.  
  1111.     LineMarkerStyleMap lineMarkerStyles() const {
  1112.         return _lineMarkerStyles;
  1113.     }
  1114.  
  1115.  
  1116.     uint maxDatasetLineMarkerStyle() const
  1117.         {
  1118.             return _maxDatasetLineMarkerStyle;
  1119.         }
  1120.  
  1121.  
  1122.     void setLineMarkerSize( QSize size )
  1123.         {
  1124.             _lineMarkerSize = size;
  1125.             emit changed();
  1126.         }
  1127.  
  1128.     QSize lineMarkerSize() const
  1129.         {
  1130.             return _lineMarkerSize;
  1131.         }
  1132.  
  1133.     void setLineWidth( int width )
  1134.         {
  1135.             _lineWidth = width;
  1136.             emit changed();
  1137.         }
  1138.  
  1139.     int lineWidth() const
  1140.         {
  1141.             return _lineWidth;
  1142.         }
  1143.  
  1144.  
  1145.     void setLineColor( QColor color = QColor() )
  1146.         {
  1147.             _lineColor = color;
  1148.             emit changed();
  1149.         }
  1150.  
  1151.     QColor lineColor() const
  1152.         {
  1153.             return _lineColor;
  1154.         }
  1155.  
  1156.     void setLineStyle( PenStyle style, uint dataset=KDCHART_GLOBAL_LINE_STYLE );
  1157.  
  1158.     PenStyle lineStyle( uint dataset=KDCHART_GLOBAL_LINE_STYLE ) const;
  1159.  
  1160.  
  1161.     void setThreeDLines( bool threeD ) {
  1162.         _threeDLines = threeD;
  1163.         emit changed();
  1164.     }
  1165.  
  1166.  
  1167.     bool threeDLines() const {
  1168.         return _threeDLines;
  1169.     }
  1170.  
  1171.  
  1172.     void setThreeDLineDepth( int depth ) {
  1173.         _threeDLineDepth = depth;
  1174.         emit changed();
  1175.     }
  1176.  
  1177.  
  1178.     int threeDLineDepth() const {
  1179.         return _threeDLineDepth;
  1180.     }
  1181.  
  1182.  
  1183.     // NOTE: documentation of this function is temporary disabled.
  1184.     // Feature is currently not supported, will be implemented
  1185.     // by future versions of KDChart
  1186.     void setThreeDLineXRotation( int degrees ) {
  1187.         _threeDLineXRotation = degrees;
  1188.         emit changed();
  1189.     }
  1190.  
  1191.  
  1192.     // NOTE: documentation of this function is temporary disabled.
  1193.     // Feature is currently not supported, will be implemented
  1194.     // by future versions of KDChart
  1195.     int threeDLineXRotation() const {
  1196.         return _threeDLineXRotation;
  1197.     }
  1198.  
  1199.  
  1200.     // NOTE: documentation of this function is temporary disabled.
  1201.     // Feature is currently not supported, will be implemented
  1202.     // by future versions of KDChart
  1203.     void setThreeDLineYRotation( int degrees ) {
  1204.         _threeDLineYRotation = degrees;
  1205.         emit changed();
  1206.     }
  1207.  
  1208.  
  1209.     // NOTE: documentation of this function is temporary disabled.
  1210.     // Feature is currently not supported, will be implemented
  1211.     // by future versions of KDChart
  1212.     int threeDLineYRotation() const {
  1213.         return _threeDLineYRotation;
  1214.     }
  1215.  
  1216. public:
  1217.     enum AreaChartSubType { AreaNormal, AreaStacked, AreaPercent };
  1218.  
  1219. public slots:
  1220.     void setAreaChartSubType( AreaChartSubType areaChartSubType )
  1221.         {
  1222.             _areaChartSubType = areaChartSubType;
  1223.             // activate default data value text settings for this chart type
  1224.             if(    printDataValues( 0 )
  1225.                    && printDataValuesWithDefaultFontParams( 0 ) )
  1226.                 setPrintDataValues( true, 0 );
  1227.             emit changed();
  1228.         }
  1229.  
  1230.  
  1231.     AreaChartSubType areaChartSubType() const
  1232.         {
  1233.             return _areaChartSubType;
  1234.         }
  1235.  
  1236.  
  1237.     static QString areaChartSubTypeToString( AreaChartSubType type );
  1238.     static AreaChartSubType stringToAreaChartSubType( const QString& string );
  1239.  
  1240. public:
  1241.     enum AreaLocation { AreaAbove, AreaBelow };
  1242. public slots:
  1243.  
  1244.     void setAreaLocation( AreaLocation location )
  1245.         {
  1246.             _areaLocation = location;
  1247.             emit changed();
  1248.         }
  1249.  
  1250.     AreaLocation areaLocation() const
  1251.         {
  1252.             return _areaLocation;
  1253.         }
  1254.  
  1255.  
  1256.     static QString areaLocationToString( AreaLocation type );
  1257.     static AreaLocation stringToAreaLocation( const QString& string );
  1258.  
  1259.     // END LINE/AREA CHART-SPECIFIC
  1260.  
  1261. public:
  1262.     // POLAR CHART-SPECIFIC
  1263.     enum PolarChartSubType { PolarNormal, PolarStacked, PolarPercent };
  1264.  
  1265. public slots:
  1266.     void setPolarChartSubType( PolarChartSubType polarChartSubType )
  1267.         {
  1268.             _polarChartSubType = polarChartSubType;
  1269.             emit changed();
  1270.         }
  1271.  
  1272.     PolarChartSubType polarChartSubType() const
  1273.         {
  1274.             return _polarChartSubType;
  1275.         }
  1276.  
  1277.  
  1278.     static PolarChartSubType stringToPolarChartSubType( const QString& string );
  1279.     static QString polarChartSubTypeToString( PolarChartSubType type );
  1280.  
  1281.     void setPolarMarker( bool marker )
  1282.         {
  1283.             _polarMarker = marker;
  1284.             emit changed();
  1285.         }
  1286.  
  1287.     bool polarMarker() const
  1288.         {
  1289.             return _polarMarker;
  1290.         }
  1291.  
  1292. public:
  1293.     enum PolarMarkerStyle { PolarMarkerCircle  = 0,
  1294.                             PolarMarkerSquare  = 1,
  1295.                             PolarMarkerDiamond = 2,
  1296.                             PolarMarker1Pixel  = 3,
  1297.                             PolarMarker4Pixels = 4,
  1298.                             PolarMarkerRing    = 5,
  1299.                             PolarMarkerCross   = 6 };
  1300.  
  1301. public slots:
  1302.     void setPolarMarkerStyle( uint dataset, PolarMarkerStyle style );
  1303.     PolarMarkerStyle polarMarkerStyle( uint dataset ) const;
  1304.     static QString polarMarkerStyleToString( PolarMarkerStyle style );
  1305.     static QString polarMarkerStyleToStringTr( PolarMarkerStyle style );
  1306.     static PolarMarkerStyle stringToPolarMarkerStyle( const QString& string );
  1307.     static PolarMarkerStyle stringToPolarMarkerStyleTr( const QString& string );
  1308.  
  1309. public:
  1310.     typedef QMap<uint,PolarMarkerStyle> PolarMarkerStyleMap;
  1311.  
  1312. public slots:
  1313.     void setPolarMarkerStyles( PolarMarkerStyleMap map );
  1314.  
  1315.     PolarMarkerStyleMap polarMarkerStyles() const {
  1316.         return _polarMarkerStyles;
  1317.     }
  1318.  
  1319.     uint maxDatasetPolarMarkerStyle() const
  1320.         {
  1321.             return _maxDatasetPolarMarkerStyle;
  1322.         }
  1323.  
  1324.     void setPolarMarkerSize( QSize size = QSize( -40, -40 ) )
  1325.         {
  1326.             _polarMarkerSize = size;
  1327.             emit changed();
  1328.         }
  1329.  
  1330.     QSize polarMarkerSize() const
  1331.         {
  1332.             return _polarMarkerSize;
  1333.         }
  1334.  
  1335.     void setPolarLineWidth( int width = -3 )
  1336.         {
  1337.             _polarLineWidth = width;
  1338.             emit changed();
  1339.         }
  1340.  
  1341.     int polarLineWidth() const
  1342.         {
  1343.             return _polarLineWidth;
  1344.         }
  1345.  
  1346.  
  1347.     void setPolarZeroDegreePos( int degrees )
  1348.         {
  1349.             _polarZeroDegreePos = degrees;
  1350.         }
  1351.  
  1352.     int polarZeroDegreePos() const
  1353.         {
  1354.             return _polarZeroDegreePos;
  1355.         }
  1356.  
  1357.  
  1358.     void setPolarRotateCircularLabels( bool rotateCircularLabels )
  1359.         {
  1360.             _polarRotateCircularLabels = rotateCircularLabels;
  1361.         }
  1362.  
  1363.     bool polarRotateCircularLabels() const
  1364.         {
  1365.             return _polarRotateCircularLabels;
  1366.         }
  1367.  
  1368.  
  1369.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  1370.     void setPolarDelimsAndLabelsAtPos( KDChartEnums::PositionFlag pos,
  1371.                                        bool showDelimiters,
  1372.                                        bool showLabels );
  1373.  
  1374.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  1375.     bool polarDelimAtPos( KDChartEnums::PositionFlag pos ) const;
  1376.  
  1377.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  1378.     bool polarLabelsAtPos( KDChartEnums::PositionFlag pos ) const;
  1379.  
  1380.     // END POLAR CHART-SPECIFIC
  1381.  
  1382.  
  1383.     // PIE/RING CHART-SPECIFIC
  1384.  
  1385.     void setExplode( bool explode )
  1386.         {
  1387.             _explode = explode;
  1388.             emit changed();
  1389.         }
  1390.  
  1391.     bool explode() const
  1392.         {
  1393.             return _explode;
  1394.         }
  1395.  
  1396.  
  1397.     void setExplodeValues( QValueList<int> explodeList ) {
  1398.         _explodeList = explodeList;
  1399.         emit changed();
  1400.     }
  1401.  
  1402.  
  1403.     // Unfortunately this is not avaialble from QSA-
  1404.     QValueList<int> explodeValues() const {
  1405.         return _explodeList;
  1406.     }
  1407.  
  1408. public:
  1409.     typedef QMap<int,double> ExplodeFactorsMap;
  1410.  
  1411. public slots:
  1412.     void setExplodeFactors( ExplodeFactorsMap factors ) {
  1413.         _explodeFactors = factors;
  1414.         emit changed();
  1415.     }
  1416.  
  1417.  
  1418.     ExplodeFactorsMap explodeFactors() const {
  1419.         return _explodeFactors;
  1420.     }
  1421.  
  1422.  
  1423.     void setExplodeFactor( double factor )
  1424.         {
  1425.             _explodeFactor = factor;
  1426.             emit changed();
  1427.         }
  1428.  
  1429.     double explodeFactor() const
  1430.         {
  1431.             return _explodeFactor;
  1432.         }
  1433.  
  1434.  
  1435.     void setThreeDPies( bool threeDPies )
  1436.         {
  1437.             _threeDPies = threeDPies;
  1438.             emit changed();
  1439.         }
  1440.  
  1441.     bool threeDPies() const
  1442.         {
  1443.             return _threeDPies;
  1444.         }
  1445.  
  1446.  
  1447.     void setThreeDPieHeight( int pixels )
  1448.         {
  1449.             _threeDPieHeight = pixels;
  1450.             emit changed();
  1451.         }
  1452.  
  1453.     int threeDPieHeight() const
  1454.         {
  1455.             return _threeDPieHeight;
  1456.         }
  1457.  
  1458.     void setPieStart( int degrees )
  1459.         {
  1460.             while ( degrees < 0 )
  1461.                 degrees += 360;
  1462.             while ( degrees >= 360 )
  1463.                 degrees -= 360;
  1464.             _pieStart = degrees;
  1465.  
  1466.             emit changed();
  1467.         }
  1468.  
  1469.  
  1470.     int pieStart() const
  1471.         {
  1472.             return _pieStart;
  1473.         }
  1474.  
  1475.     void setRingStart( int degrees )
  1476.         {
  1477.             while ( degrees < 0 )
  1478.                 degrees += 360;
  1479.             while ( degrees >= 360 )
  1480.                 degrees -= 360;
  1481.             _ringStart = degrees;
  1482.  
  1483.             emit changed();
  1484.         }
  1485.  
  1486.  
  1487.     int ringStart() const
  1488.         {
  1489.             return _ringStart;
  1490.         }
  1491.  
  1492.     void setRelativeRingThickness( bool relativeThickness ) {
  1493.         _relativeRingThickness = relativeThickness;
  1494.  
  1495.         emit changed();
  1496.     }
  1497.  
  1498.  
  1499.     bool relativeRingThickness() const {
  1500.         return _relativeRingThickness;
  1501.     }
  1502.  
  1503.     // END PIE/RING CHART-SPECIFIC
  1504.  
  1505. public:
  1506.     // HI/LO CHART-SPECIFIC
  1507.     enum HiLoChartSubType { HiLoNormal, HiLoSimple = HiLoNormal,
  1508.                             HiLoClose, HiLoOpenClose };
  1509.  
  1510. public slots:
  1511.     void setHiLoChartSubType( HiLoChartSubType hiLoChartSubType )
  1512.         {
  1513.             _hiLoChartSubType = hiLoChartSubType;
  1514.             emit changed();
  1515.         }
  1516.  
  1517.     HiLoChartSubType hiLoChartSubType() const
  1518.         {
  1519.             return _hiLoChartSubType;
  1520.         }
  1521.  
  1522.     static QString hiLoChartSubTypeToString( HiLoChartSubType type );
  1523.     static HiLoChartSubType stringToHiLoChartSubType( const QString& string );
  1524.     void setHiLoChartPrintLowValues( bool active,
  1525.                                      QFont* font = 0,
  1526.                                      int size = 14,
  1527.                                      QColor* color = 0 );
  1528.  
  1529.     bool hiLoChartPrintLowValues() const
  1530.         {
  1531.             return _hiLoChartPrintLowValues;
  1532.         }
  1533.  
  1534.  
  1535.     QFont hiLoChartLowValuesFont() const
  1536.         {
  1537.             return _hiLoChartLowValuesFont;
  1538.         }
  1539.  
  1540.  
  1541.     bool hiLoChartLowValuesUseFontRelSize() const
  1542.         {
  1543.             return _hiLoChartLowValuesUseFontRelSize;
  1544.         }
  1545.  
  1546.  
  1547.     int hiLoChartLowValuesFontRelSize() const
  1548.         {
  1549.             return _hiLoChartLowValuesFontRelSize;
  1550.         }
  1551.  
  1552.  
  1553.     QColor hiLoChartLowValuesColor() const
  1554.         {
  1555.             return _hiLoChartLowValuesColor;
  1556.         }
  1557.  
  1558.     void setHiLoChartPrintHighValues( bool active,
  1559.                                       QFont* font = 0,
  1560.                                       int size = 14,
  1561.                                       QColor* color = 0 );
  1562.  
  1563.  
  1564.     bool hiLoChartPrintHighValues() const
  1565.         {
  1566.             return _hiLoChartPrintHighValues;
  1567.         }
  1568.  
  1569.  
  1570.     QFont hiLoChartHighValuesFont() const
  1571.         {
  1572.             return _hiLoChartHighValuesFont;
  1573.         }
  1574.  
  1575.  
  1576.     bool hiLoChartHighValuesUseFontRelSize() const
  1577.         {
  1578.             return _hiLoChartHighValuesUseFontRelSize;
  1579.         }
  1580.  
  1581.  
  1582.     int hiLoChartHighValuesFontRelSize() const
  1583.         {
  1584.             return _hiLoChartHighValuesFontRelSize;
  1585.         }
  1586.  
  1587.  
  1588.     QColor hiLoChartHighValuesColor() const
  1589.         {
  1590.             return _hiLoChartHighValuesColor;
  1591.         }
  1592.  
  1593.     void setHiLoChartPrintOpenValues( bool active,
  1594.                                       QFont* font = 0,
  1595.                                       uint size = 14,
  1596.                                       QColor* color = 0 );
  1597.  
  1598.     bool hiLoChartPrintOpenValues() const
  1599.         {
  1600.             return _hiLoChartPrintOpenValues;
  1601.         }
  1602.  
  1603.  
  1604.     QFont hiLoChartOpenValuesFont() const
  1605.         {
  1606.             return _hiLoChartOpenValuesFont;
  1607.         }
  1608.  
  1609.  
  1610.     bool hiLoChartOpenValuesUseFontRelSize() const
  1611.         {
  1612.             return _hiLoChartOpenValuesUseFontRelSize;
  1613.         }
  1614.  
  1615.  
  1616.     int hiLoChartOpenValuesFontRelSize() const
  1617.         {
  1618.             return _hiLoChartOpenValuesFontRelSize;
  1619.         }
  1620.  
  1621.  
  1622.     QColor hiLoChartOpenValuesColor() const
  1623.         {
  1624.             return _hiLoChartOpenValuesColor;
  1625.         }
  1626.  
  1627.     void setHiLoChartPrintCloseValues( bool active,
  1628.                                        QFont* font = 0,
  1629.                                        int size = 14,
  1630.                                        QColor* color = 0 );
  1631.  
  1632.     bool hiLoChartPrintCloseValues() const
  1633.         {
  1634.             return _hiLoChartPrintCloseValues;
  1635.         }
  1636.  
  1637.  
  1638.     QFont hiLoChartCloseValuesFont() const
  1639.         {
  1640.             return _hiLoChartCloseValuesFont;
  1641.         }
  1642.  
  1643.  
  1644.     bool hiLoChartCloseValuesUseFontRelSize() const
  1645.         {
  1646.             return _hiLoChartCloseValuesUseFontRelSize;
  1647.         }
  1648.  
  1649.  
  1650.     int hiLoChartCloseValuesFontRelSize() const
  1651.         {
  1652.             return _hiLoChartCloseValuesFontRelSize;
  1653.         }
  1654.  
  1655.  
  1656.     QColor hiLoChartCloseValuesColor() const
  1657.         {
  1658.             return _hiLoChartCloseValuesColor;
  1659.         }
  1660.  
  1661.  
  1662.     void setHiLoChartPrintFirstValues( bool active,
  1663.                                        QFont* font = 0,
  1664.                                        uint size = 14,
  1665.                                        QColor* color = 0 )
  1666.         {
  1667.             setHiLoChartPrintOpenValues( active, font, size, color );
  1668.         }
  1669.  
  1670.     bool hiLoChartPrintFirstValues() const
  1671.         {
  1672.             return hiLoChartPrintOpenValues();
  1673.         }
  1674.  
  1675.  
  1676.     QFont hiLoChartFirstValuesFont() const
  1677.         {
  1678.             return hiLoChartOpenValuesFont();
  1679.         }
  1680.  
  1681.  
  1682.     bool hiLoChartFirstValuesUseFontRelSize() const
  1683.         {
  1684.             return hiLoChartOpenValuesUseFontRelSize();
  1685.         }
  1686.  
  1687.     int hiLoChartFirstValuesFontRelSize() const
  1688.         {
  1689.             return hiLoChartOpenValuesFontRelSize();
  1690.         }
  1691.  
  1692.     QColor hiLoChartFirstValuesColor() const
  1693.         {
  1694.             return hiLoChartOpenValuesColor();
  1695.         }
  1696.  
  1697.     void setHiLoChartPrintLastValues( bool active,
  1698.                                       QFont* font = 0,
  1699.                                       int size = 14,
  1700.                                       QColor* color = 0 )
  1701.         {
  1702.             setHiLoChartPrintCloseValues( active, font, size, color );
  1703.         }
  1704.  
  1705.     bool hiLoChartPrintLastValues() const
  1706.         {
  1707.             return hiLoChartPrintCloseValues();
  1708.         }
  1709.  
  1710.     QFont hiLoChartLastValuesFont() const
  1711.         {
  1712.             return hiLoChartCloseValuesFont();
  1713.         }
  1714.  
  1715.     bool hiLoChartLastValuesUseFontRelSize() const
  1716.         {
  1717.             return hiLoChartCloseValuesUseFontRelSize();
  1718.         }
  1719.  
  1720.     int hiLoChartLastValuesFontRelSize() const
  1721.         {
  1722.             return hiLoChartCloseValuesFontRelSize();
  1723.         }
  1724.  
  1725.     QColor hiLoChartLastValuesColor() const
  1726.         {
  1727.             return hiLoChartCloseValuesColor();
  1728.         }
  1729.  
  1730.  
  1731.     // END HI/LO CHART-SPECIFIC
  1732.  
  1733.  
  1734. public:
  1735.     // BOX WHISKER CHART-SPECIFIC
  1736.     enum BWChartSubType { BWNormal, BWSimple = BWNormal };
  1737.  
  1738.     enum BWStatVal {                  BWStatValSTART,
  1739.                                       UpperOuterFence = BWStatValSTART,  // first value stored in array
  1740.                                       UpperInnerFence,
  1741.                                       Quartile3,
  1742.                                       Median,
  1743.                                       Quartile1,
  1744.                                       LowerInnerFence,
  1745.                                       LowerOuterFence,
  1746.                                       MaxValue,
  1747.                                       MeanValue,
  1748.                                       MinValue,
  1749.                                       BWStatValEND = MinValue,          // last value stored in array
  1750.                                       //  extra values - not stored in the array:
  1751.                                       BWStatValOffEndValue,  // the number of array values
  1752.                                       BWStatValALL,          // special flag reprsenting *all* array values
  1753.                                       BWStatValUNKNOWN };    // to be returned when value is undefined
  1754. public slots:
  1755.  
  1756.     void setBWChartSubType( BWChartSubType bWChartSubType )
  1757.         {
  1758.             _BWChartSubType = bWChartSubType;
  1759.             emit changed();
  1760.         }
  1761.  
  1762.     BWChartSubType bWChartSubType() const
  1763.         {
  1764.             return _BWChartSubType;
  1765.         }
  1766.  
  1767.     static QString bWChartSubTypeToString( BWChartSubType type );
  1768.     static BWChartSubType stringToBWChartSubType( const QString& string );
  1769.     static QString bWChartStatValToString( BWStatVal type );
  1770.     static BWStatVal stringToBWChartStatVal( const QString& string );
  1771.  
  1772.     void setBWChartFences( double upperInner, double lowerInner,
  1773.                            double upperOuter, double lowerOuter );
  1774.     void bWChartFences( double& upperInner, double& lowerInner,
  1775.                         double& upperOuter, double& lowerOuter ) const;
  1776.  
  1777.     void setBWChartBrush( const QBrush& bWChartBrush )
  1778.         {
  1779.             _BWChartBrush = bWChartBrush;
  1780.             emit changed();
  1781.         }
  1782.  
  1783.     QBrush bWChartBrush() const
  1784.         {
  1785.             return _BWChartBrush;
  1786.         }
  1787.  
  1788.     void setBWChartOutValMarkerSize( int size )
  1789.         {
  1790.             _BWChartOutValMarkerSize = size;
  1791.         }
  1792.  
  1793.  
  1794.     int bWChartOutValMarkerSize() const
  1795.         {
  1796.             return _BWChartOutValMarkerSize;
  1797.         }
  1798.  
  1799.     void setBWChartPrintStatistics( BWStatVal statValue,
  1800.                                     bool active,
  1801.                                     QFont* font = 0,
  1802.                                     int size = 24,
  1803.                                     QColor* color = 0,
  1804.                                     QBrush* brush = 0 );
  1805.  
  1806.     bool bWChartPrintStatistics( BWStatVal statValue ) const
  1807.         {
  1808.             return _BWChartStatistics[ statValue ].active;
  1809.         }
  1810.  
  1811.  
  1812.     QFont bWChartStatisticsFont( BWStatVal statValue ) const
  1813.         {
  1814.             return _BWChartStatistics[ statValue ].font;
  1815.         }
  1816.  
  1817.  
  1818.     bool bWChartStatisticsUseRelSize( BWStatVal statValue ) const
  1819.         {
  1820.             return _BWChartStatistics[ statValue ].useRelSize;
  1821.         }
  1822.  
  1823.  
  1824.     int bWChartStatisticsFontRelSize( BWStatVal statValue ) const
  1825.         {
  1826.             return _BWChartStatistics[ statValue ].relSize;
  1827.         }
  1828.  
  1829.  
  1830.     QColor bWChartStatisticsColor( BWStatVal statValue ) const
  1831.         {
  1832.             return _BWChartStatistics[ statValue ].color;
  1833.         }
  1834.  
  1835.     QBrush bWChartStatisticsBrush( BWStatVal statValue ) const
  1836.         {
  1837.             return _BWChartStatistics[ statValue ].brush;
  1838.         }
  1839.  
  1840.  
  1841. public:
  1842.     // LEGENDS
  1843.  
  1844.     enum LegendPosition { NoLegend, LegendTop, LegendBottom,
  1845.                           LegendLeft, LegendRight,
  1846.                           LegendTopLeft,
  1847.                           LegendTopLeftTop,
  1848.                           LegendTopLeftLeft,
  1849.                           LegendTopRight,
  1850.                           LegendTopRightTop,
  1851.                           LegendTopRightRight,
  1852.                           LegendBottomLeft,
  1853.                           LegendBottomLeftBottom,
  1854.                           LegendBottomLeftLeft,
  1855.                           LegendBottomRight,
  1856.                           LegendBottomRightBottom,
  1857.                           LegendBottomRightRight
  1858.     };
  1859.  
  1860. public slots:
  1861.     void setLegendPosition( LegendPosition position )
  1862.         {
  1863.             _legendPosition = position;
  1864.             emit changed();
  1865.         }
  1866.  
  1867.     LegendPosition legendPosition() const
  1868.         {
  1869.             return _legendPosition;
  1870.         }
  1871.  
  1872.     void setLegendOrientation( Orientation orientation )
  1873.         {
  1874.             _legendOrientation = orientation;
  1875.             emit changed();
  1876.         }
  1877.  
  1878.     Orientation legendOrientation() const
  1879.         {
  1880.             return _legendOrientation;
  1881.         }
  1882.  
  1883.  
  1884.     void setLegendShowLines( bool legendShowLines )
  1885.         {
  1886.             _legendShowLines = legendShowLines;
  1887.             emit changed();
  1888.         }
  1889.  
  1890.     bool legendShowLines() const
  1891.         {
  1892.             return _legendShowLines;
  1893.         }
  1894.  
  1895.  
  1896.     static QString legendPositionToString( LegendPosition pos );
  1897.     static LegendPosition stringToLegendPosition( const QString& string );
  1898.  
  1899. public:
  1900.     enum LegendSource { LegendManual, LegendFirstColumn, LegendAutomatic };
  1901.  
  1902. public slots:
  1903.     void setLegendSource( LegendSource source )
  1904.         {
  1905.             _legendSource = source;
  1906.             emit changed();
  1907.         }
  1908.  
  1909.     LegendSource legendSource() const
  1910.         {
  1911.             return _legendSource;
  1912.         }
  1913.  
  1914.     static QString legendSourceToString( LegendSource source );
  1915.     static LegendSource stringToLegendSource( const QString& string );
  1916.  
  1917.     void setLegendText( uint dataset, const QString& text )
  1918.         {
  1919.             _legendText[ dataset ] = text;
  1920.             emit changed();
  1921.         }
  1922.  
  1923.     QString legendText( uint dataset ) const
  1924.         {
  1925.             if( _legendText.find( dataset ) != _legendText.end() )
  1926.                 return _legendText[ dataset ];
  1927.             else
  1928.                 return QString::null;
  1929.         }
  1930.  
  1931.  
  1932.     void setLegendTextColor( const QColor& color )
  1933.         {
  1934.             _legendTextColor = color;
  1935.             emit changed();
  1936.         }
  1937.  
  1938.  
  1939.     QColor legendTextColor() const
  1940.         {
  1941.             return _legendTextColor;
  1942.         }
  1943.  
  1944.  
  1945.     void setLegendFont( const QFont& font, bool useFontSize )
  1946.         {
  1947.             _legendFont = font;
  1948.             _legendFontUseRelSize = ! useFontSize;
  1949.             emit changed();
  1950.         }
  1951.  
  1952.     QFont legendFont() const
  1953.         {
  1954.             return _legendFont;
  1955.         }
  1956.  
  1957.  
  1958.     void setLegendFontUseRelSize( bool legendFontUseRelSize )
  1959.         {
  1960.             _legendFontUseRelSize = legendFontUseRelSize;
  1961.             emit changed();
  1962.         }
  1963.  
  1964.     bool legendFontUseRelSize() const
  1965.         {
  1966.             return _legendFontUseRelSize;
  1967.         }
  1968.  
  1969.     void setLegendFontRelSize( int legendFontRelSize )
  1970.         {
  1971.             _legendFontRelSize = legendFontRelSize;
  1972.             emit changed();
  1973.         }
  1974.  
  1975.     int legendFontRelSize() const
  1976.         {
  1977.             return _legendFontRelSize;
  1978.         }
  1979.  
  1980.  
  1981.     void setLegendTitleText( const QString& text )
  1982.         {
  1983.             _legendTitleText = text;
  1984.             emit changed();
  1985.         }
  1986.  
  1987.  
  1988.     QString legendTitleText() const
  1989.         {
  1990.             return _legendTitleText;
  1991.         }
  1992.  
  1993.  
  1994.     void setLegendTitleTextColor( const QColor& color )
  1995.         {
  1996.             _legendTitleTextColor = color;
  1997.             emit changed();
  1998.         }
  1999.  
  2000.  
  2001.     QColor legendTitleTextColor() const
  2002.         {
  2003.             return _legendTitleTextColor;
  2004.         }
  2005.  
  2006.  
  2007.  
  2008.     void setLegendTitleFont( const QFont& font, bool useFontSize )
  2009.         {
  2010.             _legendTitleFont = font;
  2011.             _legendTitleFontUseRelSize = ! useFontSize;
  2012.             emit changed();
  2013.         }
  2014.  
  2015.     QFont legendTitleFont() const
  2016.         {
  2017.             return _legendTitleFont;
  2018.         }
  2019.  
  2020.  
  2021.     void setLegendTitleFontUseRelSize( bool legendTitleFontUseRelSize )
  2022.         {
  2023.             _legendTitleFontUseRelSize = legendTitleFontUseRelSize;
  2024.             emit changed();
  2025.         }
  2026.  
  2027.     bool legendTitleFontUseRelSize() const
  2028.         {
  2029.             return _legendTitleFontUseRelSize;
  2030.         }
  2031.  
  2032.     void setLegendTitleFontRelSize( int legendTitleFontRelSize )
  2033.         {
  2034.             _legendTitleFontRelSize = legendTitleFontRelSize;
  2035.             emit changed();
  2036.         }
  2037.  
  2038.     int legendTitleFontRelSize() const
  2039.         {
  2040.             return _legendTitleFontRelSize;
  2041.         }
  2042.  
  2043.  
  2044.     void setLegendSpacing( uint space )
  2045.         {
  2046.             _legendSpacing = space;
  2047.         }
  2048.  
  2049.  
  2050.     uint legendSpacing() const
  2051.         {
  2052.             return _legendSpacing;
  2053.         }
  2054.  
  2055.     // END LEGENDS
  2056.  
  2057.  
  2058.  
  2059.     // AXES
  2060.  
  2061.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  2062.     void setAxisType( uint n, const KDChartAxisParams::AxisType axisType )
  2063.         {
  2064.             if ( n < KDCHART_MAX_AXES ) {
  2065.                 _axisSettings[ n ].params.setAxisType( axisType );
  2066.                 emit changed();
  2067.             }
  2068.         }
  2069.  
  2070.     void setAxisVisible( uint n,
  2071.                          const bool axisVisible )
  2072.         {
  2073.             if ( n < KDCHART_MAX_AXES ) {
  2074.                 _axisSettings[ n ].params.setAxisVisible( axisVisible );
  2075.                 emit changed();
  2076.             }
  2077.         }
  2078.  
  2079.     bool axisVisible( uint n ) const
  2080.         {
  2081.             return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params.axisVisible()
  2082.                 : false;
  2083.         }
  2084.  
  2085.     void setAxisShowGrid( uint n,
  2086.                           bool axisShowGrid );
  2087.     bool showGrid() const;
  2088.     void setAxisDatasets( uint n,
  2089.                           uint dataset,
  2090.                           uint dataset2 = KDCHART_NO_DATASET,
  2091.                           uint chart = 0 );
  2092.     bool axisDatasets( uint n,
  2093.                        uint& dataset,
  2094.                        uint& dataset2,
  2095.                        uint& chart ) const;
  2096.  
  2097. public:
  2098. #if COMPAT_QT_VERSION >= 0x030000
  2099.     typedef QValueVector<uint> AxesArray;
  2100. #else
  2101.     typedef QArray<uint> AxesArray;
  2102. #endif
  2103.  
  2104. public slots:
  2105.     bool chartAxes( uint chart, uint& cnt, AxesArray& axes ) const;
  2106.  
  2107.     void setAxisArea( const uint n, const QRect& areaRect )
  2108.         {
  2109.             if ( n < KDCHART_MAX_AXES ) {
  2110.                 _axisSettings[ n ].params.setAxisTrueAreaRect( areaRect );
  2111.                 // Do not do emit changed() here!
  2112.             }
  2113.         }
  2114.  
  2115.     void setAxisLabelsTouchEdges( uint n, bool axisLabelsTouchEdges )
  2116.         {
  2117.             _axisSettings[ n ].params.setAxisLabelsTouchEdges(
  2118.                 axisLabelsTouchEdges );
  2119.             emit changed();
  2120.         }
  2121.  
  2122.     void setAxisLabelsVisible( uint n,
  2123.                                bool axisLabelsVisible )
  2124.         {
  2125.             if ( n < KDCHART_MAX_AXES )
  2126.                 _axisSettings[ n ].params.setAxisLabelsVisible( axisLabelsVisible );
  2127.         }
  2128.  
  2129.     void setAxisLabelsFont( uint n,
  2130.                             QFont axisLabelsFont,
  2131.                             int axisLabelsFontSize = 0,
  2132.                             QColor axisLabelsColor = Qt::black );
  2133.  
  2134.     // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
  2135.     void setAxisLabelTextParams( uint n,
  2136.                                  bool axisSteadyValueCalc   = true,
  2137.                                  QVariant axisValueStart = KDCHART_AXIS_LABELS_AUTO_LIMIT,
  2138.                                  QVariant axisValueEnd   = KDCHART_AXIS_LABELS_AUTO_LIMIT,
  2139.                                  double axisValueDelta      = KDCHART_AXIS_LABELS_AUTO_DELTA,
  2140.                                  int axisDigitsBehindComma  = KDCHART_AXIS_LABELS_AUTO_DIGITS,
  2141.                                  int axisMaxEmptyInnerSpan  = 67,
  2142.                                  KDChartAxisParams::LabelsFromDataRow takeLabelsFromDataRow
  2143.                                  = KDChartAxisParams::LabelsFromDataRowNo,
  2144.                                  int labelTextsDataRow      = 0,
  2145.                                  QStringList* axisLabelStringList = 0,
  2146.                                  QStringList* axisShortLabelsStringList = 0,
  2147.                                  int axisValueLeaveOut      = KDCHART_AXIS_LABELS_AUTO_LEAVEOUT,
  2148.                                  KDChartAxisParams::ValueScale axisValueDeltaScale = KDChartAxisParams::ValueScaleNumerical )
  2149.         {
  2150.             _axisSettings[ n ].params.setAxisValues(
  2151.                 axisSteadyValueCalc,
  2152.                 axisValueStart,
  2153.                 axisValueEnd,
  2154.                 axisValueDelta,
  2155.                 axisDigitsBehindComma,
  2156.                 axisMaxEmptyInnerSpan,
  2157.                 takeLabelsFromDataRow,
  2158.                 labelTextsDataRow,
  2159.                 axisLabelStringList,
  2160.                 axisShortLabelsStringList,
  2161.                 axisValueLeaveOut,
  2162.                 axisValueDeltaScale );
  2163.             emit changed();
  2164.         }
  2165.  
  2166.  
  2167.     void setAxisLabelStringParams( uint n,
  2168.                                    QStringList* axisLabelStringList,
  2169.                                    QStringList* axisShortLabelStringList,
  2170.                                    const QString& valueStart = QString::null,
  2171.                                    const QString& valueEnd   = QString::null );
  2172.  
  2173.  
  2174.     void setAxisParams( uint n,
  2175.                         const KDChartAxisParams& axisParams );
  2176.  
  2177.     const KDChartAxisParams& axisParams( uint n ) const
  2178.         {
  2179.             return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params
  2180.                 : _axisSettings[ KDCHART_MAX_AXES ].params;
  2181.         }
  2182.  
  2183.     // some convenience functions refering to the first KDChartCustomBox
  2184.     // that is anchored to the axis n.
  2185.     bool findFirstAxisCustomBoxID(   uint n, uint& boxID ) const;
  2186.     void setAxisTitle(               uint n, const QString& axisTitle );
  2187.  
  2188.     QString axisTitle(               uint n ) const;
  2189.     void setAxisTitleColor(          uint n, QColor axisTitleColor );
  2190.     QColor axisTitleColor(           uint n ) const;
  2191.     void setAxisTitleFont(           uint n, QFont axisTitleFont );
  2192.     void setAxisTitleFont(           uint n, QFont axisTitleFont, bool useFixedFontSize );
  2193.     QFont axisTitleFont(             uint n ) const;
  2194.     void setAxisTitleFontUseRelSize( uint n, bool useRelSize );
  2195.     bool axisTitleFontUseRelSize(    uint n ) const;
  2196.     void setAxisTitleFontRelSize(    uint n, int axisTitleFontRelSize );
  2197.     int axisTitleFontRelSize(        uint n ) const;
  2198.  
  2199.     QRect axisArea( const uint n ) const
  2200.         {
  2201.             if ( n < KDCHART_MAX_AXES ) {
  2202.                 return _axisSettings[ n ].params.axisTrueAreaRect();
  2203.                 // Do not do emit changed() here!
  2204.             }else{
  2205.                 return QRect(QPoint(0,0),QSize(0,0));
  2206.             }
  2207.         }
  2208.     // END AXES
  2209.  
  2210.  
  2211.  
  2212.     QRect dataArea()   const { return _dataAreaRect; }
  2213.     QRect legendArea() const { return _legendAreaRect; }
  2214.  
  2215.  
  2216.  
  2217.     // HEADERS/FOOTERS
  2218.  
  2219. public:
  2220.  
  2221.     /*
  2222.       READ before changing/enhancing the following enum
  2223.       =================================================
  2224.  
  2225.       Please note: The following enum is made in a way that
  2226.       sections with smaller Y values come first.
  2227.       Thus one can construct a loop itterating over theHdFtPos values
  2228.       and so going from the top of the screen toiwards the bottom...
  2229.  
  2230.       Also please note that extending this enum shound NOT break the
  2231.       tripple groups (numbers 0/1/2, 3/4/5, and 6/7/8) since the
  2232.       algorithms in
  2233.       KDChartPainter::setupGeometry() and
  2234.       KDChartPainter::paintHeaderFooter() rely on this schema.
  2235.       Also don't forget to always update the auxiliary values
  2236.       HdFtPosSTART, HdFtPosHeadersSTART,
  2237.       HdFtPosHeadersEND, HdFtPosFootersSTART,
  2238.       HdFtPosFootersEND, and HdFtPosEND muessen - these are used
  2239.       fpr other itarators...
  2240.     */
  2241.     enum HdFtPos{ // start of all sections
  2242.         HdFtPosSTART = 0,
  2243.  
  2244.         // headers:
  2245.         HdFtPosHeadersSTART  = 0,
  2246.         // top-most headers
  2247.         HdFtPosHeaders0START = 0,
  2248.         HdFtPosHeader0       = 0,
  2249.         HdFtPosHeader0L = 1,
  2250.         HdFtPosHeader0R      = 2,
  2251.         HdFtPosHeaders0END   = 2,
  2252.         // normal ( == middle ) headers
  2253.         HdFtPosHeaders1START = 3,
  2254.         HdFtPosHeader        = 3,        // center
  2255.         HdFtPosHeaderL = 4,              // left
  2256.         HdFtPosHeaderR       = 5,        // right
  2257.         HdFtPosHeaders1END   = 5,
  2258.         // bottom headers
  2259.         HdFtPosHeaders2START = 6,
  2260.         HdFtPosHeader2       = 6,
  2261.         HdFtPosHeader2L = 7,
  2262.         HdFtPosHeader2R      = 8,
  2263.         HdFtPosHeaders2END   = 8,
  2264.  
  2265.         HdFtPosHeadersEND = 8,
  2266.  
  2267.         // footers:
  2268.         HdFtPosFootersSTART = 9,
  2269.         // normal ( == middle ) footers
  2270.         HdFtPosFooters1START =  9,
  2271.         HdFtPosFooter        =  9,
  2272.         HdFtPosFooterL = 10,
  2273.         HdFtPosFooterR       = 11,
  2274.         HdFtPosFooters1END   = 11,
  2275.         // bottom footers
  2276.         HdFtPosFooters2START = 12,
  2277.         HdFtPosFooter2       = 12,
  2278.         HdFtPosFooter2L = 13,
  2279.         HdFtPosFooter2R      = 14,
  2280.         HdFtPosFooters2END   = 14,
  2281.         // top-most footers
  2282.         HdFtPosFooters0START = 15,
  2283.         HdFtPosFooter0       = 15,
  2284.         HdFtPosFooter0L = 16,
  2285.         HdFtPosFooter0R      = 17,
  2286.         HdFtPosFooters0END   = 17,
  2287.  
  2288.         HdFtPosFootersEND = 17,
  2289.  
  2290.         HdFtPosEND = 17 };
  2291.  
  2292. public slots:
  2293.  
  2294.     void setHeaderFooterText( uint pos, const QString& text );
  2295.     QString headerFooterText( uint pos ) const;
  2296.     const QRect& headerFooterRect( uint pos ) const;
  2297.     void setHeaderFooterColor( uint pos, const QColor color );
  2298.     QColor headerFooterColor( uint pos ) const;
  2299.     void setHeaderFooterFont( uint pos, const QFont& font,
  2300.                               bool fontUseRelSize,
  2301.                               int fontRelSize );
  2302.     QFont headerFooterFont( uint pos ) const;
  2303.     bool headerFooterFontUseRelSize( uint pos ) const;
  2304.     int headerFooterFontRelSize( uint pos ) const;
  2305.  
  2306.  
  2307.     // quick&dirty functions: access Header, Header2 and Footer
  2308.     //                        without having to specify the HdFtPos
  2309.     //
  2310.     // This may be convenient for specifying simple charts with
  2311.     // up to two centered header(s) and up to one centered footer.
  2312.  
  2313.  
  2314.     void setHeader1Text( const QString& text )
  2315.         {
  2316.             _hdFtParams[ HdFtPosHeader ]._text = text;
  2317.             emit changed();
  2318.         }
  2319.  
  2320.  
  2321.     QString header1Text() const
  2322.         {
  2323.             return _hdFtParams[ HdFtPosHeader ]._text;
  2324.         }
  2325.  
  2326.     void setHeader1Font( const QFont& font )
  2327.         {
  2328.             _hdFtParams[ HdFtPosHeader ]._font = font;
  2329.             emit changed();
  2330.         }
  2331.  
  2332.  
  2333.     QFont header1Font() const
  2334.         {
  2335.             return _hdFtParams[ HdFtPosHeader ]._font;
  2336.         }
  2337.  
  2338.     void setHeader2Text( const QString& text )
  2339.         {
  2340.             _hdFtParams[ HdFtPosHeader2 ]._text = text;
  2341.             emit changed();
  2342.         }
  2343.  
  2344.  
  2345.     QString header2Text() const
  2346.         {
  2347.             return _hdFtParams[ HdFtPosHeader2 ]._text;
  2348.         }
  2349.  
  2350.     void setHeader2Font( const QFont& font )
  2351.         {
  2352.             _hdFtParams[ HdFtPosHeader2 ]._font = font;
  2353.             emit changed();
  2354.         }
  2355.  
  2356.  
  2357.     QFont header2Font() const
  2358.         {
  2359.             return _hdFtParams[ HdFtPosHeader2 ]._font;
  2360.         }
  2361.  
  2362.  
  2363.  
  2364.     void setFooterText( const QString& text )
  2365.         {
  2366.             _hdFtParams[ HdFtPosFooter ]._text = text;
  2367.             emit changed();
  2368.         }
  2369.  
  2370.  
  2371.     QString footerText() const
  2372.         {
  2373.             return _hdFtParams[ HdFtPosFooter ]._text;
  2374.         }
  2375.  
  2376.     void setFooterFont( const QFont& font )
  2377.         {
  2378.             _hdFtParams[ HdFtPosFooter ]._font = font;
  2379.             emit changed();
  2380.         }
  2381.  
  2382.  
  2383.     QFont footerFont() const
  2384.         {
  2385.             return _hdFtParams[ HdFtPosFooter ]._font;
  2386.         }
  2387.  
  2388.  
  2389.     /**
  2390.        \internal
  2391.     */
  2392.     void __internalStoreHdFtRect( int pos, QRect rect )
  2393.         {
  2394.             if ( 0 <= pos && HdFtPosEND >= pos )
  2395.                 _hdFtParams[ pos ].setRect( rect );
  2396.         }
  2397.  
  2398.  
  2399.     // END HEADERS/FOOTERS
  2400.  
  2401.  
  2402.  
  2403. public:
  2404.     KDChartParams();
  2405.     virtual ~KDChartParams();
  2406.  
  2407. public slots:
  2408.     void loadAxesFormXML(int& curAxisSettings, QDomElement& element);
  2409.     bool loadXML( const QDomDocument& doc );
  2410.  
  2411.     void saveAxesToXML(QDomDocument& doc, QDomElement& docRoot) const;
  2412.     QDomDocument saveXML( bool withPI = true ) const;
  2413.  
  2414. public:
  2415.     friend QTextStream& operator<<( QTextStream& s, const KDChartParams& p );
  2416.     friend QTextStream& operator>>( QTextStream& s, KDChartParams& p );
  2417.  
  2418. public slots:
  2419.     static void createChartValueNode( QDomDocument& doc, QDomNode& parent,
  2420.                                       const QString& elementName,
  2421.                                       const QVariant& valY,
  2422.                                       const QVariant& valX,
  2423.                                       const int& propID  );
  2424.     static void createColorMapNode( QDomDocument& doc, QDomNode& parent,
  2425.                                     const QString& elementName,
  2426.                                     const QMap< uint, QColor >& map );
  2427.     static void createDoubleMapNode( QDomDocument& doc, QDomNode& parent,
  2428.                                      const QString& elementName,
  2429.                                      const QMap< int, double >& map );
  2430.     static void createChartFontNode( QDomDocument& doc, QDomNode& parent,
  2431.                                      const QString& elementName,
  2432.                                      const QFont& font, bool useRelFont,
  2433.                                      int relFont,
  2434.                                      int minFont=-1 );
  2435.     static bool readColorMapNode( const QDomElement& element,
  2436.                                   QMap<uint,QColor>* map );
  2437.     static bool readDoubleMapNode( const QDomElement& element,
  2438.                                    QMap<int,double>* map );
  2439.     static bool readChartFontNode( const QDomElement& element, QFont& font,
  2440.                                    bool& useRelFont, int& relFontSize,
  2441.                                    int* minFontSize=0 );
  2442.     static bool readChartValueNode( const QDomElement& element,
  2443.                                     QVariant& valY,
  2444.                                     QVariant& valX,
  2445.                                     int& propID );
  2446.  
  2447.  
  2448.     // do *not* call this function manually: it is used by KDChartPainter::setupGeometry()
  2449.     void setDataArea( const QRect& areaRect )
  2450.         {
  2451.             _dataAreaRect = areaRect;
  2452.             // Do not do emit changed() here!
  2453.         }
  2454.     // do *not* call this function manually: it is used by KDChartPainter::setupGeometry()
  2455.     void setLegendArea( const QRect& areaRect )
  2456.         {
  2457.             _legendAreaRect = areaRect;
  2458.             // Do not do emit changed() here!
  2459.         }
  2460.  
  2461.  
  2462. signals:
  2463.     void changed();
  2464.  
  2465.  
  2466. protected:
  2467.     void setBarsDisplayed( int barsDisplayed )
  2468.         {
  2469.             _barsDisplayed = barsDisplayed;
  2470.         }
  2471.     void setBarsLeft( int barsLeft )
  2472.         {
  2473.             _barsLeft = barsLeft;
  2474.         }
  2475.  
  2476.  
  2477. private:
  2478.     QString dataRegionFrameAreaName( uint dataRow,
  2479.                              uint dataCol,
  2480.                              uint data3rd );
  2481.     void recomputeShadowColors();
  2482.     void insertDefaultAxisTitleBox( uint n,
  2483.                                     bool setTitle,       const QString& axisTitle,
  2484.                                     bool setColor,       const QColor& axisTitleColor,
  2485.                                     bool setFont,        const QFont& axisTitleFont,
  2486.                                     bool setFontUseRel,  bool useFontSize,
  2487.                                     bool setFontRelSize, int axisTitleFontRelSize );
  2488.  
  2489.     static QColor _internalPointer_DataValueAutoColor;
  2490.  
  2491.     KDChartPropertySet* tempPropSetA;
  2492.     KDChartPropertySet* tempPropSetB;
  2493.  
  2494.     bool _optimizeOutputForScreen;
  2495.     int _globalLeadingLeft;
  2496.     int _globalLeadingTop;
  2497.     int _globalLeadingRight;
  2498.     int _globalLeadingBottom;
  2499.     ChartType _chartType;
  2500.     ChartType _additionalChartType;
  2501.     int _numValues;
  2502.     QFont _defaultFont;
  2503.  
  2504.     typedef QDict < KDChartFrameSettings > AreaDict;
  2505.     AreaDict _areaDict;
  2506.  
  2507.     CustomBoxDict _customBoxDict;
  2508.     bool _customBoxDictMayContainHoles;
  2509.     QRect _noRect;
  2510.     KDFrame _noFrame;
  2511.  
  2512.     KDChartFrameSettings _noFrameSettings;
  2513.  
  2514.     class ModeAndChart
  2515.     {
  2516.     public:
  2517.         ModeAndChart()
  2518.             : _mode( UnknownMode ), _chart( KDCHART_NO_CHART )
  2519.             {}
  2520.         ModeAndChart( SourceMode mode, uint chart )
  2521.             : _mode( mode ), _chart( chart )
  2522.             {}
  2523.  
  2524.         SourceMode mode() const
  2525.             {
  2526.                 return _mode;
  2527.             };
  2528.         uint chart() const
  2529.             {
  2530.                 return _chart;
  2531.             };
  2532.  
  2533.         void setMode( SourceMode mode )
  2534.             {
  2535.                 _mode = mode;
  2536.             };
  2537.         void setChart( uint chart )
  2538.             {
  2539.                 _chart = chart;
  2540.             };
  2541.     private:
  2542.         SourceMode _mode;
  2543.         uint _chart;
  2544.     };
  2545.  
  2546.     typedef QMap < uint, ModeAndChart > ModeAndChartMap;
  2547.     ModeAndChartMap _dataSourceModeAndChart;
  2548.     bool _setChartSourceModeWasUsed;
  2549.     QMap < uint, QColor > _dataColors;
  2550.     uint _maxDatasetSourceMode;
  2551.     KDChartPropertySetList _propertySetList;
  2552.     double _shadowBrightnessFactor;
  2553.     Qt::BrushStyle _shadowPattern;
  2554.     bool _threeDShadowColors;
  2555.     uint _maxDatasetColor;
  2556.     QMap < uint, QColor > _dataColorsShadow1;
  2557.     QMap < uint, QColor > _dataColorsShadow2;
  2558.     QColor _outlineDataColor;
  2559.     uint _outlineDataLineWidth;
  2560.     PenStyle _outlineDataLineStyle;
  2561.  
  2562.  
  2563.     struct PrintDataValuesSettings {
  2564.         bool _printDataValues;
  2565.         int _divPow10;
  2566.         int _digitsBehindComma;
  2567.         QFont _dataValuesFont;
  2568.         bool _dataValuesUseFontRelSize;
  2569.         int _dataValuesFontRelSize;
  2570.         QColor _dataValuesColor;
  2571.         QBrush _dataValuesBrush;
  2572.         bool _dataValuesAutoColor;
  2573.         KDChartEnums::PositionFlag _dataValuesAnchorNegativePosition;
  2574.         uint _dataValuesAnchorNegativeAlign;
  2575.         int _dataValuesAnchorNegativeDeltaX;
  2576.         int _dataValuesAnchorNegativeDeltaY;
  2577.         int _dataValuesNegativeRotation;
  2578.         KDChartEnums::PositionFlag _dataValuesAnchorPositivePosition;
  2579.         uint _dataValuesAnchorPositiveAlign;
  2580.         int _dataValuesAnchorPositiveDeltaX;
  2581.         int _dataValuesAnchorPositiveDeltaY;
  2582.         int _dataValuesPositiveRotation;
  2583.         KDChartEnums::TextLayoutPolicy _dataValuesLayoutPolicy;
  2584.         bool _dataValuesShowInfinite;
  2585.  
  2586.         bool _useDefaultFontParams;  // internal flag, do NOT store it!
  2587.     };
  2588.     PrintDataValuesSettings _printDataValuesSettings;
  2589.     PrintDataValuesSettings _printDataValuesSettings2;
  2590.  
  2591.     bool _allowOverlappingDataValueTexts;
  2592.     BarChartSubType _barChartSubType;
  2593.     bool _threeDBars;
  2594.     int _threeDBarAngle;
  2595.     double _threeDBarDepth;
  2596.     double _cosThreeDBarAngle;
  2597.     int _datasetGap;
  2598.     bool _datasetGapIsRelative;
  2599.     int _valueBlockGap;
  2600.     bool _valueBlockGapIsRelative;
  2601.     int _barWidth;
  2602.     int _userWidth;
  2603.     bool _solidExcessArrows;
  2604.     // volatile bar chart information, not saved in the stream
  2605.     QRect _dataAreaRect;
  2606.     QRect _legendAreaRect;
  2607.     int _barsDisplayed;
  2608.     int _barsLeft;
  2609.  
  2610.     // LINES/AREAS-specific
  2611.     LineChartSubType _lineChartSubType;
  2612.     bool _threeDLines;
  2613.     int _threeDLineDepth;
  2614.     int _threeDLineXRotation;
  2615.     int _threeDLineYRotation;
  2616.     bool _lineMarker;
  2617.     LineMarkerStyleMap _lineMarkerStyles;
  2618.     uint _maxDatasetLineMarkerStyle;
  2619.     QSize _lineMarkerSize;
  2620.     QColor _lineColor;
  2621.     int _lineWidth;
  2622.     PenStyle _lineStyle;
  2623.     typedef QMap<uint, PenStyle> LineStyleMap;
  2624.     LineStyleMap _datasetLineStyles;
  2625.     AreaChartSubType _areaChartSubType;
  2626.     AreaLocation _areaLocation;
  2627.  
  2628.  
  2629.     // POLAR-specific
  2630.     PolarChartSubType _polarChartSubType;
  2631.     bool _polarMarker;
  2632.     PolarMarkerStyleMap _polarMarkerStyles;
  2633.     uint _maxDatasetPolarMarkerStyle;
  2634.     QSize _polarMarkerSize;
  2635.     int _polarLineWidth;
  2636.     int _polarZeroDegreePos;
  2637.     bool _polarRotateCircularLabels;
  2638.     struct _polarDelimsAndLabelStruct {
  2639.         bool showDelimiters;
  2640.         bool showLabels;
  2641.     };
  2642.     _polarDelimsAndLabelStruct _polarDelimsAndLabels[ 1 + KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS ];
  2643.  
  2644.  
  2645.  
  2646.     // PIES/RINGS
  2647.     bool _explode;
  2648.     double _explodeFactor;
  2649.     ExplodeFactorsMap _explodeFactors;
  2650.     QValueList<int> _explodeList;
  2651.     bool _threeDPies;
  2652.     int _threeDPieHeight;
  2653.     int _pieStart;
  2654.     int _ringStart;
  2655.     bool _relativeRingThickness;
  2656.  
  2657.  
  2658.     // HI-LO CHARTS
  2659.  
  2660.     HiLoChartSubType _hiLoChartSubType;
  2661.     bool _hiLoChartPrintLowValues;
  2662.     QFont _hiLoChartLowValuesFont;
  2663.     bool _hiLoChartLowValuesUseFontRelSize;
  2664.     int _hiLoChartLowValuesFontRelSize;
  2665.     QColor _hiLoChartLowValuesColor;
  2666.     bool _hiLoChartPrintHighValues;
  2667.     QFont _hiLoChartHighValuesFont;
  2668.     bool _hiLoChartHighValuesUseFontRelSize;
  2669.     int _hiLoChartHighValuesFontRelSize;
  2670.     QColor _hiLoChartHighValuesColor;
  2671.     bool _hiLoChartPrintOpenValues;
  2672.     QFont _hiLoChartOpenValuesFont;
  2673.     bool _hiLoChartOpenValuesUseFontRelSize;
  2674.     int _hiLoChartOpenValuesFontRelSize;
  2675.     QColor _hiLoChartOpenValuesColor;
  2676.     bool _hiLoChartPrintCloseValues;
  2677.     QFont _hiLoChartCloseValuesFont;
  2678.     bool _hiLoChartCloseValuesUseFontRelSize;
  2679.     int _hiLoChartCloseValuesFontRelSize;
  2680.     QColor _hiLoChartCloseValuesColor;
  2681.  
  2682.  
  2683.  
  2684.     // BOX AND WHISKER CHARTS
  2685.  
  2686.     BWChartSubType _BWChartSubType;
  2687.  
  2688.     struct BWChartStatistics {
  2689.         double value;
  2690.         int    y;
  2691.         bool   active;
  2692.         QFont  font;
  2693.         bool   useRelSize;
  2694.         int    relSize;
  2695.         QColor color;
  2696.         QBrush brush;
  2697.     };
  2698.     BWChartStatistics _BWChartStatistics[ BWStatValOffEndValue ];
  2699.     double _BWChartFenceUpperInner;
  2700.     double _BWChartFenceLowerInner;
  2701.     double _BWChartFenceUpperOuter;
  2702.     double _BWChartFenceLowerOuter;
  2703.     int _BWChartOutValMarkerSize;
  2704.     QBrush _BWChartBrush;
  2705.  
  2706.  
  2707.     // LEGENDS
  2708.  
  2709.     LegendPosition _legendPosition;
  2710.     Qt::Orientation _legendOrientation;
  2711.     bool _legendShowLines;
  2712.     LegendSource _legendSource;
  2713.     QMap < int, QString > _legendText;
  2714.     QColor _legendTextColor;
  2715.     QFont _legendFont;
  2716.     bool _legendFontUseRelSize;
  2717.     int _legendFontRelSize;
  2718.     QString _legendTitleText;
  2719.     QColor _legendTitleTextColor;
  2720.     QFont _legendTitleFont;
  2721.     bool _legendTitleFontUseRelSize;
  2722.     int _legendTitleFontRelSize;
  2723.     uint _legendSpacing;
  2724.  
  2725.  
  2726.     // AXES (private)
  2727.     // Must be exported because of the inline methods
  2728.     struct KDCHART_EXPORT AxisSettings
  2729.     {
  2730.         uint dataset;
  2731.         uint dataset2;
  2732.         uint chart;
  2733.         KDChartAxisParams params;
  2734.         AxisSettings()
  2735.             {
  2736.                 dataset = KDCHART_NO_DATASET;
  2737.                 dataset2 = KDCHART_NO_DATASET;
  2738.                 chart = KDCHART_NO_CHART;
  2739.             }
  2740.     };
  2741.  
  2742.     // 13 == KDCHART_MAX_AXES + 1
  2743.     AxisSettings _axisSettings[ 13 ];
  2744.     // END AXES (private)
  2745.  
  2746.  
  2747.     // HEADER/FOOTER (private)
  2748.     // Must be exported because of the inline methods
  2749.     struct KDCHART_EXPORT HdFtParams
  2750.     {
  2751.         QString _text;
  2752.         QColor _color;
  2753.         QFont _font;
  2754.         bool _fontUseRelSize;
  2755.         int _fontRelSize;
  2756.         HdFtParams()
  2757.             {
  2758.                 _color = QColor( Qt::black );
  2759.                 _font = QFont( "helvetica", 10, QFont::Normal, false );
  2760.                 _fontUseRelSize = true;
  2761.                 _fontRelSize = 8; // per default quite small
  2762.             }
  2763.         void setRect( QRect rect )
  2764.             {
  2765.                 _rect = rect;
  2766.             }
  2767.         const QRect& rect() const
  2768.             {
  2769.                 return _rect;
  2770.             }
  2771.     private:
  2772.         // temporary data that are NOT to be stored within sessions:
  2773.         QRect _rect;
  2774.     };
  2775.  
  2776.     HdFtParams _hdFtParams[ HdFtPosEND + 1 ];
  2777.     // END HEADER/FOOTER (private)
  2778. };
  2779.  
  2780.  
  2781. QTextStream& operator<<( QTextStream& s, const KDChartParams& p );
  2782.  
  2783.  
  2784. QTextStream& operator>>( QTextStream& s, KDChartParams& p );
  2785.  
  2786.  
  2787. #endif
  2788.